package com.action.newbroad;

import com.db.newbroad.*;
import java.util.*;

public class InsertAction {

	private int no;
	private String id;
	private String subject;
	private String content;
	private String pwd;
	private Date writeday;
	private NewbroadDAO newbroad;

	public NewbroadDAO getNewbroad() {
		return newbroad;
	}

	public void setNewbroad(NewbroadDAO newbroad) {
		this.newbroad = newbroad;
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String insert() throws Exception {

		NewbroadVO vo = new NewbroadVO();
		vo.setId(id);
		vo.setSubject(subject);
		vo.setContent(content);
		vo.setPwd(pwd);

		newbroad.newbroadInsert(vo);

		return "success";
	}

	public String update() throws Exception {

		NewbroadVO vo = new NewbroadVO();

		vo.setNo(no);
		vo.setSubject(subject);
		vo.setContent(content);
		vo.setWriteday(writeday);
		vo.setPwd(pwd);

		System.out.println(vo.toString());

		newbroad.newbroadUpdate(vo);

		return "success";
	}

}